package com.zm.spring.demo;

import com.zm.spring.demo.biz.UserBiz;
import com.zm.spring.demo.mapper.UserMapper;
import com.zm.spring.demo.web.UserController;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = AnnoConfig.class)
public class IocConfig {
    @Autowired  //自动配置注解
    UserController userController;

    @Autowired  //自动配置注解
    UserBiz userBiz;

    @Autowired  //自动配置注解
    UserMapper userMapper;
    @Test
    public void test(){
        System.out.println("userController = " + userController);
        System.out.println("userBiz = " + userBiz);
        System.out.println("userMapper = " + userMapper);
    }
}
